package com.hwd.srb.core.enmu;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.Arrays;

/**
 * @author 黄伟东/Victor
 * @date 2022/3/25 17:57
 * @Description 数据字典一级目录枚举类
 */
@NoArgsConstructor
@AllArgsConstructor
@Getter
public enum DictEnum {

    INDUSTRY("industry", "行业"),
    EDUCATION("education", "学历"),
    INCOME("income", "收入"),
    RETURN_SOURCE("returnSource", "收入来源"),
    BORROW_STATUS("borrowStatus", "借款状态"),
    MONEY_USER("moneyUse", "资金用途"),
    RETURN_METHOD("returnMethod", "还款方式"),
    RELATION("relation", "关系"),
    SCHOOL_STATUS("SchoolStatus", "学校性质"),
    ;

    private String dictCode;
    private String msg;

    public static String getMsgByDictCode(String dictCode) {
        return Arrays.stream(DictEnum.values())
                .filter(i -> i.getDictCode().equals(dictCode))
                .map(DictEnum::getMsg)
                .findFirst()
                .orElse("");
    }

}
